---
title: DuckDuckGo
---

**DuckDuckGo** enables an Agent to search the web for information.

## Prerequisites

The following example requires the `ddgs` library. To install DuckDuckGo, run the following command:

```shell
pip install -U ddgs
```

## Example

```python cookbook/tools/duckduckgo.py
from agno.agent import Agent
from agno.tools.duckduckgo import DuckDuckGoTools

agent = Agent(tools=[DuckDuckGoTools()])
agent.print_response("Whats happening in France?", markdown=True)
```

## Toolkit Params

| Parameter           | Type              | Default | Description                                                                                          |
| ------------------- | ----------------- | ------- | ---------------------------------------------------------------------------------------------------- |
| `enable_search`     | `bool`            | `True`  | Enable DuckDuckGo search function.                                                                  |
| `enable_news`       | `bool`            | `True`  | Enable DuckDuckGo news function.                                                                    |
| `all`               | `bool`            | `False` | Enable all available functions in the toolkit.                                                      |
| `modifier`          | `Optional[str]`   | `None`  | A modifier to be used in the search request.                                                        |
| `fixed_max_results` | `Optional[int]`   | `None`  | A fixed number of maximum results.                                                                  |
| `proxy`             | `Optional[str]`   | `None`  | Proxy to be used in the search request.                                                             |
| `timeout`           | `Optional[int]`   | `10`    | The maximum number of seconds to wait for a response.                                               |
| `verify_ssl`        | `bool`            | `True`  | Whether to verify SSL certificates.                                                                 |

## Toolkit Functions

| Function            | Description                                                                                                                                                         |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `duckduckgo_search` | Search DuckDuckGo for a query. Parameters include `query` (str) for the search query and `max_results` (int, default=5) for maximum results. Returns JSON formatted search results. |
| `duckduckgo_news`   | Get the latest news from DuckDuckGo. Parameters include `query` (str) for the search query and `max_results` (int, default=5) for maximum results. Returns JSON formatted news results. |

## Developer Resources

- View [Tools](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/tools/duckduckgo.py)
- View [Cookbook](https://github.com/agno-agi/agno/tree/main/cookbook/tools/duckduckgo_tools.py)
